import java.util.Scanner;
public class javademo {
    public static void main(String[] args) {
        System.out.println("请输入一个年份");
        System.out.println("1000~2000闰年如下");
        for (int year =1000; year <=2000 ; year++) {
            if((year%4==0&&year%100!=0)||year%400==0){
                System.out.println(year);
            }
        }
    }



    public static void main9(String[] args) {
        int n=0;
      //  System.out.println("jhgh");
        for (int i = 1; i <=100 ; i++) {
            int sum=0;
            for (int j = 1; j <= i; j++) {
                if(i%j==0){
                    sum++;
                }
            }
            if(sum==2){
                System.out.println(i);
            }
        }
    }



    public static void main8(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入一个数字");
        int n=scanner.nextInt();
        int sum=0;
        for (int i = 1; i <= n; i++) {
            if(n%i==0){
                sum++;
            }
        }
        if(sum==2){
            System.out.println("是质数");
        }else{
            System.out.println("不是质数");
        }
    }


    public static void main7(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int age=0;
        System.out.println("请输入年龄");
        age=scanner.nextInt();
        if(age<=18){
            System.out.println("少年");
        }if(age>=19&&age<=28){
            System.out.println("青年");
        }if(age>=29&&age<=55){
            System.out.println("中年");
        }if(age>=56){
            System.out.println("老年");
        }
    }


    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=0;
        System.out.println("请输入你要判断的整数");
        n=scanner.nextInt();
        int count_n=n;
        int pan=n;
        int sum=0;//储存整数n的位数
        while(count_n!=0){
            count_n/=10;
            sum++;
        }
        //System.out.println(sum);
        int flower_sum=0;
        for (int i = 0; i < sum; i++) {
            int sre=n%10;
            int ret=(sre)*(sre)*(sre);
            flower_sum+=ret;
            n/=10;
        }
        //System.out.println(flower_sum);
        if(flower_sum==pan){
            System.out.println("该整数是一个水仙花数");
        }
    }




    public static void main5(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入两个整数a,b");
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int ret=a*b;
        if(b>a){
            int temp=b;
            b=a;
            a=temp;
        }
        int c=a%b;
        while(c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println("最大公约数为"+b);
    }



    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一个整数n");
        int n=scanner.nextInt();
        int download=n;
        System.out.println("二进制偶数位列表如下");
        for (int i = 1; i <=32 ; i++) {
            int temp=(n&1);
            n=n>>1;
            if(i%2==0){
                System.out.printf("%d",temp);
            }
        }
        n=download;
        System.out.println(" ");
        System.out.println("二进制奇数位列表如下");
        for (int i = 1; i <=32 ; i++) {
            int temp=(n&1);
            n=n>>1;
            if(i%2!=0){
                System.out.printf("%d",temp);
            }
        }
    }



    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一个整数n");
        int n=scanner.nextInt();
        int sum=0;
        for (int i = 1; i <=32 ; i++) {

            int temp=(n&1);
            n=n>>1;
            sum+=temp;
        }
        System.out.println("该整数二进制中有"+sum+"个1");
    }




    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str="bg1234";
       // String input=" ";
        System.out.println("正确密码-》"+str);
        int n=0;
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入你的密码");
           String input=scanner.nextLine();
           boolean flag=str.equals(input);
            if(flag){
                System.out.println("恭喜靓仔，密码正确");
                break;
            }
            if(!flag){
                System.out.println("密码错误");
                System.out.printf("你还剩%d次机会\n", 3-i-1);
            }

        }
    }

    public static void main1(String[] args) {
        System.out.println("请输入整数n的值");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.printf("%d*%d=%d ", j, i, j * i);
            }
             System.out.println(" ");

        }
    }
}
